package com.user.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.user.bean.Page;
import com.user.bean.User;

/**
 *  This is User Dao
 * @author LIU
 * @version 1.0 2017-09-21
 */
public interface UserDao {

	/**
	 * Show all users
	 *TODO
	 *LIU
	 * @return
	 *����10:49:57
	 */
	List<User> showAll();

	/**
	 * User login
	 *TODO
	 *LIU
	 * @param user
	 * @return boolean
	 *����10:50:11
	 */
	int login(User user);

	/**
	 * Add user
	 *TODO
	 *LIU
	 * @param user
	 * @return int
	 *����10:50:24
	 */
	int addUser(User user);

	/**
	 * Update user by Id
	 *TODO
	 *LIU
	 * @param user
	 * @param userId
	 * @return int
	 *����10:50:40
	 */
	int updateUser(User user, String userId);

	/**
	 * Search user by Id
	 *TODO
	 *LIU
	 * @param userId
	 * @return User
	 *����10:50:56
	 */
	User searchUser(String userId);

	/**
	 * Delete user by Id
	 *TODO
	 *LIU
	 * @param userId
	 * @return int
	 *����10:51:06
	 */
	int deleteUser(String userId);

	/**
	 * Get all counts of users
	 *TODO
	 *LIU
	 * @return
	 *上午11:32:55
	 */
	int getAllCounts();

	/**
	 * Get user by page
	 *TODO
	 *LIU
	 * @param p
	 * @return
	 *上午11:44:17
	 */
	List<User> showAll(Page p);

}
